package exception;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

public class AutoCloseableDemo {
    public static void main(String[] args) {
        try(FileOutputStream fos = new FileOutputStream("note.txt");
                )
        {fos.write(1);}
        catch (FileNotFoundException e) {
            throw new RuntimeException(e);
        }
       catch (IOException e) {
            System.out.println("关闭失败");
        }
    }
}
